home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 July & August / rerun-1986-07-08.d64 / mag production (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  154 lines

  1. 0 goto 100
  2. 1 rem mag prod v1.2
  3. 2 rem (c) 1986 david a. hook
  4. 9 rem position at rec #r
  5. 10 print#15,"p"+chr$(3)+chr$(rand255)+chr$(r/256)+chr$(1):return
  6. 19 rem disk error check
  7. 20 input#15,de,de$,t,s: if de<20 or de=50 or de=51 then return
  8. 25 print " [196]isk [197]rror[146]";de;de$;t;s
  9. 30 close 3: close 2: close 15: end
  10. 49 rem exit subroutine
  11. 50 close 3: close 2: close 15
  12. 55 print " [208]ress [211][208][193][195][197] [212]o [197]xit"
  13. 60 get z$: if z$<>chr$(32) goto 60
  14. 65 return
  15. 100 a$="abcdefghijklmnopqrst": a$=a$+a$+"u"
  16. 120 rem issue name, drive#, max pages
  17. 130 read f3$, d3$, mp
  18. 150 lp=25: ad=896: ck=0: if peek(ad)=160 goto 190
  19. 160 for i=ad to ad+41: read da: poke i,da: ck=ck+da: next
  20. 180 if ck<>6121 then print "error in data": stop
  21. 190 :
  22. 200 print "[147]"; tab(11); "[211][207][198][212][215][193][210][197] [205][193][199][193][218][201][206][197]"; spc(21); "(c)1986 [196]avid [193]. [200]ook"
  23. 210 print " 1. [195]reate [206]ew [201]ssue": print " 2. [193]dd [212]o [193]n [201]ssue"
  24. 220 print " 3. [212]able [207]f [195]ontents": print " 4. [196]elete [212]ext [198]iles"
  25. 230 print " 5. [198]ix [208]age [195]ounter": print " 6. [209]uit [208]rogram"
  26. 250 print " [195]hoice (1-5): ?[157]";
  27. 260 get z$: if z$<"1" or z$>"6" goto 260
  28. 270 print ""; z$
  29. 280 for i=1 to 1500: next
  30. 300 on val(z$) gosub 1000, 2000, 3000, 4000, 5000, 30
  31. 310 goto 200
  32. 499 rem issue sbr
  33. 500 print" [208]lace the [201]ssue [196]isk in the drive"
  34. 510 print ""; tab(15); f3$
  35. 520 input "[145] [201]ssue [206]ame: "; f3$
  36. 530 print tab(15); d3$
  37. 540 input "[145] [207]n [196]rive #: "; d3$
  38. 560 open 15, 8, 15, "i"+d3$: gosub 20
  39. 580 f$ = d3$ + ":" + f3$: if z$="1" then f$= f3$ + ",l,"+ chr$(40)
  40. 590 open 3, 8, 3, f$: gosub 20
  41. 610 return
  42. 999 rem create new issue
  43. 1000 print "[147]"; tab(12); "[195]reate [206]ew [201]ssue"
  44. 1010 print" [208]lace a [198]ormatted [196]isk in the drive"
  45. 1020 gosub 510
  46. 1040 print ""; tab(14); mp
  47. 1050 input "[145] [205]ax [208]age #: "; mp
  48. 1070 print " [208]lease wait a few moments..."
  49. 1090 rem create last record
  50. 1100 ln=lp*mp+1
  51. 1110 r=ln: gosub 10
  52. 1120 print#3, chr$(255)
  53. 1130 r=ln: gosub 10
  54. 1150 rem point to issue page 2
  55. 1160 r=1: gosub 10
  56. 1170 print#3, lp+1
  57. 1180 r=1: gosub 10
  58. 1200 gosub 20
  59. 1220 print " [196]one."
  60. 1240 goto 50
  61. 1999 rem add to an issue
  62. 2000 print "[147]"; tab(12); "[193]dd [212]o [193]n [201]ssue"
  63. 2010 gosub 500
  64. 2030 input " [212]ext [198]ile:    *[157][157][157]"; f2$
  65. 2040 if f2$="*" goto 2030
  66. 2050 input " [207]n [196]rive #:   0[157][157][157]"; d2$
  67. 2060 if d2$<>"0" and d2$<>"1" goto 2050
  68. 2080 if d2$<>d3$ then print#15, "i"+d2$: gosub 20
  69. 2100 open 2, 8, 2, d2$+":"+f2$: gosub 20
  70. 2120 print " [215]orking..."
  71. 2140 rem fetch line count
  72. 2150 r=1: gosub 10
  73. 2160 input#3, n: fl=n
  74. 2170 r=1: gosub 10
  75. 2190 rem bump count
  76. 2200 n=n+1
  77. 2220 rem get text line
  78. 2230 sys ad: ss=st
  79. 2240 l=peek(142)
  80. 2260 rem write it to issue
  81. 2270 r=n: gosub 10
  82. 2280 print#3, left$(a$,l)
  83. 2290 r=n: gosub 10
  84. 2310 gosub 20
  85. 2330 rem check end of file
  86. 2340 if ss=0 goto 2200
  87. 2360 rem update line count
  88. 2370 r=1: gosub 10
  89. 2380 print#3, n: ll=n
  90. 2390 r=1: gosub 10
  91. 2410 print " [211]tart: [208]age"; (fl-1)/lp+1
  92. 2420 print "   [197]nd: [208]age"; (ll-1)/lp
  93. 2440 goto 50
  94. 2999 rem table of contents
  95. 3000 print "[147]"; tab(11); "[212]able [207]f [195]ontents"
  96. 3010 gosub 500
  97. 3030 input " [195]ontents:     *[157][157][157]"; f2$
  98. 3040 if f2$="*" goto 3030
  99. 3050 input " [207]n [196]rive #:   0[157][157][157]"; d2$
  100. 3060 if d2$<>"0" and d2$<>"1" goto 3050
  101. 3080 if d2$<>d3$ then print#15, "i"+d2$: gosub 20
  102. 3100 open 2, 8, 2, d2$+":"+f2$: gosub 20
  103. 3120 rem set to first line
  104. 3130 n=1
  105. 3150 rem bump count
  106. 3160 n=n+1
  107. 3180 rem get text line
  108. 3190 sys ad: ss=st
  109. 3200 l=peek(142)
  110. 3220 rem write it to issue
  111. 3230 r=n: gosub 10
  112. 3240 print#3, left$(a$,l)
  113. 3250 r=n: gosub 10
  114. 3270 gosub 20
  115. 3290 rem check end of file
  116. 3300 if ss=0 goto 3160
  117. 3320 goto 50
  118. 3999 rem delete text files
  119. 4000 print "[147]"; tab(11); "[196]elete [212]ext [198]iles"
  120. 4010 print " [208]lace the [212]ext [198]ile [196]isk in drive #0"
  121. 4020 input " [212]ext [198]ile prefix:   p/[157][157][157][157]"; pr$
  122. 4030 if pr$="*" goto 4020
  123. 4050 print " [211]cratch [198]iles prefixed with: "; chr$(34); pr$; chr$(34)
  124. 4060 input " [201]s this [207][203] (y/n):  n[157][157][157]"; z$
  125. 4070 if z$<>"y" then return
  126. 4090 print " [215]orking..."
  127. 4110 open 15, 8, 15, "i"+d3$: gosub 20
  128. 4130 print#15, "s0:"+pr$+"*": gosub 20
  129. 4140 print " "; de$;t
  130. 4160 goto 50
  131. 4999 rem fix page counter
  132. 5000 print "[147]"; tab(12); "[198]ix [208]age [195]ounter"
  133. 5010 gosub 500
  134. 5030 rem fetch line count
  135. 5040 r=1: gosub 10
  136. 5050 input#3, n
  137. 5060 r=1: gosub 10
  138. 5080 rem offer change
  139. 5090 print ""; tab(22); (n-1)/lp
  140. 5100 input "[145] [195]hange [197]nd [208]age to: "; n
  141. 5120 rem update line count
  142. 5130 r=1: gosub10
  143. 5140 print#3, n*lp+1
  144. 5150 r=1: gosub10
  145. 5170 goto 50
  146. 7000 rem issue name, drive #
  147. 7010 data "jul86", 0
  148. 7100 rem max # of pages
  149. 7110 data 60
  150. 8000 rem c64 string thing data (file 2)
  151. 8010 data 160,2,177,45,153,137,0,200,192,6,208,246,162,2
  152. 8020 data 32,198,255,32,228,255,201,13,240,15,164,142,145,140
  153. 8030 data 200,132,142,196,139,240,4,165,144,240,234,76,204,255
  154.